package cn.foolishbird.crow.pay;

import cn.foolishbird.crow.core.CrowEnum;
import cn.foolishbird.crow.core.IdentityStrategy;
import cn.foolishbird.crow.pay.request.PreOrderRequest;
import cn.foolishbird.crow.pay.request.QueryPayRequest;
import cn.foolishbird.crow.pay.request.QueryRefundRequest;
import cn.foolishbird.crow.pay.request.RefundRequest;
import cn.foolishbird.crow.pay.response.ProOrderResponse;
import cn.foolishbird.crow.pay.response.RefundResponse;

/**
 * @author foolish-bird
 */
public interface Payment extends IdentityStrategy<Enum<? extends CrowEnum>> {

    /**
     * 预下单，发起支付
     *
     * @param preOrderRequest
     * @return
     */
    ProOrderResponse preOrder(PreOrderRequest preOrderRequest) throws Exception;

    /**
     * 支付接口
     *
     * @param orderInfo
     * @return
     * @throws Exception
     */
    ProOrderResponse payment(Object orderInfo) throws Exception;

    /**
     * 查询支付
     *
     * @param param
     * @return
     */
    ProOrderResponse queryPay(QueryPayRequest param) throws Exception;

    /**
     * 发起退款
     *
     * @param refundRequest
     * @return
     */
    RefundResponse refund(RefundRequest refundRequest) throws Exception;

    /**
     * 查询退款接口
     *
     * @param param
     * @return
     */
    RefundResponse queryRefund(QueryRefundRequest param) throws Exception;

}
